home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1993-10-23 | 5.8 KB | [ ttro/ttxt]
open in: MacOS 8.1
extracted
|
Win98
extracted
|
DOS
extracted
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary ).
You can browse this item here: PR's Driver code - READ ME!
Confidence Program Detection Match Type Support
10%
dexvert
MacBinary (archive/macBinary)
fallback
Supported
1%
dexvert
Text File (text/txt)
fallback
Supported
100%
file
MacBinary II, Sat Oct 23 18:06:34 1993, modified Sat Oct 23 18:06:34 1993, creator SimpleText, type SimpleText read-only, 5369 bytes "PR's Driver code - READ ME!" , at 0x1579 286 bytes resource
default (weak)
99%
file
data
default
74%
TrID
Mac SimpleText read-only (MacBinary)
default
25%
TrID
MacBinary 2
default (weak)
100%
siegfried
fmt/1762 MacBinary (II)
default
100%
lsar
MacBinary
default
id metadata key value macFileType [ ttro] macFileCreator [ ttxt]
hex view +--------+-------------------------+-------------------------+--------+--------+ |00000000| 00 1b 50 52 27 73 20 44 | 72 69 76 65 72 20 63 6f |..PR's D|river co| |00000010| 64 65 20 2d 20 52 45 41 | 44 20 4d 45 21 00 00 00 |de - REA|D ME!...| |00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |00000040| 00 74 74 72 6f 74 74 78 | 74 00 00 00 00 00 00 00 |.ttrottx|t.......| |00000050| 00 00 00 00 00 14 f9 00 | 00 01 1e a8 ef 5b 6a a8 |........|.....[j.| |00000060| ef 5b 6a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.[j.....|........| |00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 4d 85 00 00 |........|....M...| |00000080| 49 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 63 6f 6e 63 |Informat|ion conc| |00000090| 65 72 6e 69 6e 67 20 74 | 68 65 20 69 6e 73 74 61 |erning t|he insta| |000000a0| 6c 6c 61 74 69 6f 6e 20 | 6f 66 20 64 65 76 69 63 |llation |of devic| |000000b0| 65 20 64 72 69 76 65 72 | 73 0d 2d 2d 2d 2d 2d 2d |e driver|s.------| |000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |000000d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------| |000000e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 0d 0d 54 |--------|-----..T| |000000f0| 48 49 4e 4b 20 43 20 70 | 72 6f 76 69 64 65 73 20 |HINK C p|rovides | |00000100| 61 20 76 65 72 79 20 6e | 69 63 65 20 65 6e 76 69 |a very n|ice envi| |00000110| 72 6f 6e 6d 65 6e 74 20 | 66 6f 72 20 77 72 69 74 |ronment |for writ| |00000120| 69 6e 67 20 64 65 76 69 | 63 65 20 64 72 69 76 65 |ing devi|ce drive| |00000130| 72 73 2e 20 55 6e 66 6f | 72 74 75 6e 61 74 65 6c |rs. Unfo|rtunatel| |00000140| 79 2c 20 74 68 65 79 20 | 64 6f 20 6e 6f 74 20 74 |y, they |do not t| |00000150| 65 6c 6c 20 79 6f 75 20 | 68 6f 77 20 74 6f 20 67 |ell you |how to g| |00000160| 65 74 20 74 68 65 6d 20 | 69 6e 73 74 61 6c 6c 65 |et them |installe| |00000170| 64 20 61 6e 64 20 72 75 | 6e 6e 69 6e 67 2e 20 54 |d and ru|nning. T| |00000180| 68 69 73 20 64 6f 63 75 | 6d 65 6e 74 2c 20 61 6e |his docu|ment, an| |00000190| 64 20 74 68 65 20 63 6f | 64 65 20 70 72 6f 76 69 |d the co|de provi| |000001a0| 64 65 64 20 68 65 72 65 | 2c 20 77 69 6c 6c 20 67 |ded here|, will g| |000001b0| 69 76 65 20 73 6f 6d 65 | 20 62 61 63 6b 67 72 6f |ive some| backgro| |000001c0| 75 6e 64 20 6f 6e 20 74 | 68 65 20 70 72 6f 62 6c |und on t|he probl| |000001d0| 65 6d 20 61 6e 64 20 73 | 6f 6c 75 74 69 6f 6e 73 |em and s|olutions| |000001e0| 2e 20 52 65 66 65 72 20 | 74 6f 20 74 68 65 20 44 |. Refer |to the D| |000001f0| 65 76 69 63 65 20 4d 61 | 6e 61 67 65 72 20 63 68 |evice Ma|nager ch| |00000200| 61 70 74 65 72 20 6f 66 | 20 49 6e 73 69 64 65 20 |apter of| Inside | |00000210| 4d 61 63 69 6e 74 6f 73 | 68 20 66 6f 72 20 6d 6f |Macintos|h for mo| |00000220| 72 65 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 2e 0d |re infor|mation..| |00000230| 0d 44 65 76 69 63 65 20 | 64 72 69 76 65 72 73 20 |.Device |drivers | |00000240| 61 72 65 20 73 70 65 63 | 69 61 6c 20 70 69 65 63 |are spec|ial piec| |00000250| 65 73 20 6f 66 20 63 6f | 64 65 20 74 68 61 74 20 |es of co|de that | |00000260| 74 68 65 20 44 65 76 69 | 63 65 20 4d 61 6e 61 67 |the Devi|ce Manag| |00000270| 65 72 20 69 73 20 69 6e | 20 63 68 61 72 67 65 20 |er is in| charge | |00000280| 6f 66 20 63 61 6c 6c 69 | 6e 67 2e 20 54 6f 20 6b |of calli|ng. To k| |00000290| 65 65 70 20 74 72 61 63 | 6b 20 6f 66 20 64 65 76 |eep trac|k of dev| |000002a0| 69 63 65 20 64 72 69 76 | 65 72 73 2c 20 74 68 65 |ice driv|ers, the| |000002b0| 20 44 65 76 69 63 65 20 | 4d 61 6e 61 67 65 72 20 | Device |Manager | |000002c0| 6b 65 65 70 73 20 61 20 | 74 61 62 6c 65 20 69 6e |keeps a |table in| |000002d0| 20 74 68 65 20 73 79 73 | 74 65 6d 20 68 65 61 70 | the sys|tem heap| |000002e0| 20 63 61 6c 6c 65 64 20 | 74 68 65 20 75 6e 69 74 | called |the unit| |000002f0| 20 74 61 62 6c 65 2c 20 | 77 68 69 63 68 20 69 73 | table, |which is| |00000300| 20 6a 75 73 74 20 61 6e | 20 61 72 72 61 79 20 6f | just an| array o| |00000310| 66 20 68 61 6e 64 6c 65 | 73 2e 20 45 61 63 68 20 |f handle|s. Each | |00000320| 68 61 6e 64 6c 65 20 69 | 73 20 61 20 64 65 76 69 |handle i|s a devi| |00000330| 63 65 20 63 6f 6e 74 72 | 6f 6c 20 65 6e 74 72 79 |ce contr|ol entry| |00000340| 20 68 61 6e 64 6c 65 2c | 20 77 68 69 63 68 20 69 | handle,| which i| |00000350| 73 20 77 68 65 72 65 20 | 74 68 65 20 44 65 76 69 |s where |the Devi| |00000360| 63 65 20 4d 61 6e 61 67 | 65 72 20 73 74 6f 72 65 |ce Manag|er store| |00000370| 73 20 61 6c 6c 20 6f 66 | 20 74 68 65 20 69 6e 66 |s all of| the inf| |00000380| 6f 72 6d 61 74 69 6f 6e | 20 69 74 20 6e 65 65 64 |ormation| it need| |00000390| 73 20 66 6f 72 20 65 61 | 63 68 20 64 65 76 69 63 |s for ea|ch devic| |000003a0| 65 20 64 72 69 76 65 72 | 2e 20 4f 6e 65 20 66 69 |e driver|. One fi| |000003b0| 65 6c 64 20 6f 66 20 74 | 68 65 20 64 65 76 69 63 |eld of t|he devic| |000003c0| 65 20 63 6f 6e 74 72 6f | 6c 20 65 6e 74 72 79 20 |e contro|l entry | |000003d0| 69 73 20 74 68 65 20 68 | 61 6e 64 6c 65 20 6f 66 |is the h|andle of| |000003e0| 20 74 68 65 20 64 65 76 | 69 63 65 20 64 72 69 76 | the dev|ice driv| |000003f0| 65 72 20 63 6f 64 65 2e | 20 28 49 66 20 74 68 65 |er code.| (If the| |00000400| 20 64 65 76 69 63 65 20 | 64 72 69 76 65 72 20 69 | device |driver i| |00000410| 73 20 69 6e 20 52 4f 4d | 2c 20 74 68 65 6e 20 74 |s in ROM|, then t| |00000420| 68 65 20 66 69 65 6c 64 | 20 69 73 20 72 65 61 6c |he field| is real| |00000430| 6c 79 20 61 20 70 6f 69 | 6e 74 65 72 20 74 6f 20 |ly a poi|nter to | |00000440| 74 68 65 20 52 4f 4d 20 | 63 6f 64 65 2e 29 20 57 |the ROM |code.) W| |00000450| 68 65 6e 20 74 68 65 20 | 4f 70 65 6e 44 72 69 76 |hen the |OpenDriv| |00000460| 65 72 20 72 6f 75 74 69 | 6e 65 20 69 73 20 63 61 |er routi|ne is ca| |00000470| 6c 6c 65 64 2c 20 69 74 | 20 6e 6f 72 6d 61 6c 6c |lled, it| normall| |00000480| 79 20 72 65 61 64 73 20 | 74 68 65 20 64 72 69 76 |y reads |the driv| |00000490| 65 72 20 72 65 73 6f 75 | 72 63 65 20 6f 75 74 20 |er resou|rce out | |000004a0| 6f 66 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |of the r|esource | |000004b0| 66 69 6c 65 2c 20 61 6e | 64 20 74 68 65 6e 20 63 |file, an|d then c| |000004c0| 61 6c 6c 73 20 74 68 65 | 20 5f 44 72 76 72 49 6e |alls the| _DrvrIn| |000004d0| 73 74 61 6c 6c 20 74 72 | 61 70 20 74 6f 20 63 72 |stall tr|ap to cr| |000004e0| 65 61 74 65 20 61 20 64 | 65 76 69 63 65 20 63 6f |eate a d|evice co| |000004f0| 6e 74 72 6f 6c 20 65 6e | 74 72 79 20 61 6e 64 20 |ntrol en|try and | |00000500| 69 6e 73 74 61 6c 6c 20 | 69 74 20 69 6e 74 6f 20 |install |it into | |00000510| 74 68 65 20 75 6e 69 74 | 20 74 61 62 6c 65 2e 20 |the unit| table. | |00000520| 28 49 66 20 74 68 65 20 | 64 72 69 76 65 72 20 77 |(If the |driver w| |00000530| 61 73 20 61 6c 72 65 61 | 64 79 20 69 6e 73 74 61 |as alrea|dy insta| |00000540| 6c 6c 65 64 20 69 6e 20 | 74 68 65 20 75 6e 69 74 |lled in |the unit| |00000550| 20 74 61 62 6c 65 2c 20 | 4f 70 65 6e 44 72 69 76 | table, |OpenDriv| |00000560| 65 72 20 6a 75 73 74 20 | 63 61 6c 6c 73 20 74 68 |er just |calls th| |00000570| 65 20 64 72 69 76 65 72 | 73 20 6f 70 65 6e 20 72 |e driver|s open r| |00000580| 6f 75 74 69 6e 65 20 61 | 6e 64 20 73 65 74 73 20 |outine a|nd sets | |00000590| 61 20 66 6c 61 67 20 69 | 6e 20 74 68 65 20 64 65 |a flag i|n the de| |000005a0| 76 69 63 65 20 63 6f 6e | 74 72 6f 6c 20 65 6e 74 |vice con|trol ent| |000005b0| 72 79 20 74 6f 20 22 6f | 70 65 6e 22 2e 29 20 4f |ry to "o|pen".) O| |000005c0| 70 65 6e 44 72 69 76 65 | 72 20 75 73 65 73 20 74 |penDrive|r uses t| |000005d0| 68 65 20 72 65 73 6f 75 | 72 63 65 20 49 44 20 6f |he resou|rce ID o| |000005e0| 66 20 74 68 65 20 64 72 | 69 76 65 72 20 61 73 20 |f the dr|iver as | |000005f0| 74 68 65 20 70 6c 61 63 | 65 20 69 6e 20 74 68 65 |the plac|e in the| |00000600| 20 75 6e 69 74 20 74 61 | 62 6c 65 20 69 6e 20 77 | unit ta|ble in w| |00000610| 68 69 63 68 20 74 6f 20 | 69 6e 73 74 61 6c 6c 20 |hich to |install | |00000620| 74 68 65 20 64 72 69 76 | 65 72 2e 20 46 6f 72 20 |the driv|er. For | |00000630| 69 6e 73 74 61 6e 63 65 | 2c 20 74 68 65 20 72 65 |instance|, the re| |00000640| 73 6f 75 72 63 65 20 49 | 44 20 66 6f 72 20 74 68 |source I|D for th| |00000650| 65 20 53 6f 6e 79 20 64 | 69 73 6b 20 64 72 69 76 |e Sony d|isk driv| |00000660| 65 72 20 69 73 20 31 2c | 20 73 6f 20 74 68 65 20 |er is 1,| so the | |00000670| 64 65 76 69 63 65 20 63 | 6f 6e 74 72 6f 6c 20 65 |device c|ontrol e| |00000680| 6e 74 72 79 20 66 6f 72 | 20 74 68 61 74 20 64 72 |ntry for| that dr| |00000690| 69 76 65 72 20 69 73 20 | 69 6e 20 73 6c 6f 74 20 |iver is |in slot | |000006a0| 31 20 6f 66 20 74 68 65 | 20 75 6e 69 74 20 74 61 |1 of the| unit ta| |000006b0| 62 6c 65 2e 20 54 68 69 | 73 20 77 6f 72 6b 73 20 |ble. Thi|s works | |000006c0| 6a 75 73 74 20 66 69 6e | 65 20 66 6f 72 20 74 68 |just fin|e for th| |000006d0| 65 20 4d 61 63 69 6e 74 | 6f 73 68 20 4f 53 2c 20 |e Macint|osh OS, | |000006e0| 62 75 74 20 6e 6f 74 20 | 73 6f 20 67 72 65 61 74 |but not |so great| |000006f0| 20 66 6f 72 20 75 73 20 | 66 6f 6c 6b 73 20 77 68 | for us |folks wh| |00000700| 6f 20 77 61 6e 74 20 74 | 6f 20 77 72 69 74 65 20 |o want t|o write | |00000710| 6f 75 72 20 6f 77 6e 20 | 64 72 69 76 65 72 73 2e |our own |drivers.| |00000720| 0d 0d 54 68 65 72 65 20 | 61 72 65 20 32 20 70 72 |..There |are 2 pr| |00000730| 6f 62 6c 65 6d 73 3a 20 | 28 61 29 20 54 68 65 20 |oblems: |(a) The | |00000740| 4d 61 63 69 6e 74 6f 73 | 68 20 4f 53 20 6b 6e 6f |Macintos|h OS kno| |00000750| 77 73 20 77 68 65 72 65 | 20 61 6c 6c 20 6f 66 20 |ws where| all of | |00000760| 69 74 73 20 64 65 76 69 | 63 65 20 64 72 69 76 65 |its devi|ce drive| |00000770| 72 73 20 61 72 65 20 67 | 6f 69 6e 67 20 74 6f 20 |rs are g|oing to | |00000780| 62 65 20 69 6e 73 74 61 | 6c 6c 65 64 20 62 65 66 |be insta|lled bef| |00000790| 6f 72 65 20 62 6f 6f 74 | 20 74 69 6d 65 20 61 6e |ore boot| time an| |000007a0| 64 20 63 61 6e 20 6e 75 | 6d 62 65 72 20 69 74 73 |d can nu|mber its| |000007b0| 20 64 72 69 76 65 72 20 | 72 65 73 6f 75 72 63 65 | driver |resource| |000007c0| 73 20 61 70 70 72 6f 70 | 72 69 61 74 65 6c 79 3b |s approp|riately;| |000007d0| 20 69 66 20 79 6f 75 20 | 61 6e 64 20 49 20 77 72 | if you |and I wr| |000007e0| 69 74 65 20 64 72 69 76 | 65 72 73 20 74 68 61 74 |ite driv|ers that| |000007f0| 20 68 61 76 65 20 74 68 | 65 20 73 61 6d 65 20 72 | have th|e same r| |00000800| 65 73 6f 75 72 63 65 20 | 49 44 2c 20 77 65 20 61 |esource |ID, we a| |00000810| 72 65 20 67 6f 69 6e 67 | 20 74 6f 20 74 72 79 20 |re going| to try | |00000820| 61 6e 64 20 69 6e 73 74 | 61 6c 6c 20 6f 6e 20 74 |and inst|all on t| |00000830| 6f 70 20 6f 66 20 65 61 | 63 68 6f 74 68 65 72 2c |op of ea|chother,| |00000840| 20 77 68 69 63 68 20 77 | 6f 75 6c 64 20 62 65 20 | which w|ould be | |00000850| 62 61 64 2e 20 28 62 29 | 20 54 68 65 20 66 69 72 |bad. (b)| The fir| |00000860| 73 74 20 34 38 20 73 6c | 6f 74 73 20 69 6e 20 74 |st 48 sl|ots in t| |00000870| 68 65 20 64 72 69 76 65 | 72 20 74 61 62 6c 65 20 |he drive|r table | |00000880| 61 72 65 20 72 65 73 65 | 72 76 65 64 20 74 6f 20 |are rese|rved to | |00000890| 74 68 65 20 4d 61 63 69 | 6e 74 6f 73 68 20 4f 53 |the Maci|ntosh OS| |000008a0| 20 64 72 69 76 65 72 73 | 20 61 6e 64 20 64 65 73 | drivers| and des| |000008b0| 6b 20 61 63 63 65 73 73 | 6f 72 69 65 73 2e 20 55 |k access|ories. U| |000008c0| 6e 66 6f 72 74 75 6e 61 | 74 65 6c 79 2c 20 6f 6e |nfortuna|tely, on| |000008d0| 20 74 68 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 50 | the Mac|intosh P| |000008e0| 6c 75 73 2c 20 74 68 65 | 72 65 20 61 72 65 20 6f |lus, the|re are o| |000008f0| 6e 6c 79 20 34 38 20 73 | 6c 6f 74 73 20 74 6f 20 |nly 48 s|lots to | |00000900| 62 65 67 69 6e 20 77 69 | 74 68 2e 20 54 68 65 20 |begin wi|th. The | |00000910| 4d 61 63 69 6e 74 6f 73 | 68 20 53 45 20 68 61 73 |Macintos|h SE has| |00000920| 20 6f 6e 6c 79 20 36 34 | 20 73 6c 6f 74 73 2c 20 | only 64| slots, | |00000930| 73 6f 20 77 65 20 6d 69 | 67 68 74 20 65 76 65 6e |so we mi|ght even| |00000940| 20 72 75 6e 20 6f 75 74 | 20 6f 66 20 72 6f 6f 6d | run out| of room| |00000950| 20 74 68 65 72 65 2e 0d | 0d 54 68 65 20 73 6f 6c | there..|.The sol| |00000960| 75 74 69 6f 6e 20 74 6f | 20 70 72 6f 62 6c 65 6d |ution to| problem| |00000970| 20 28 61 29 20 69 73 20 | 70 72 65 74 74 79 20 65 | (a) is |pretty e| |00000980| 61 73 79 2e 20 54 68 65 | 20 4d 61 63 69 6e 74 6f |asy. The| Macinto| |00000990| 73 68 20 4f 53 20 69 73 | 20 6b 69 6e 64 20 65 6e |sh OS is| kind en| |000009a0| 6f 75 67 68 20 74 6f 20 | 6d 61 6b 65 20 73 75 72 |ough to |make sur| |000009b0| 65 20 74 68 61 74 20 65 | 6d 70 74 79 20 73 6c 6f |e that e|mpty slo| |000009c0| 74 73 20 69 6e 20 74 68 | 65 20 75 6e 69 74 20 74 |ts in th|e unit t| |000009d0| 61 62 6c 65 20 61 72 65 | 20 6d 61 72 6b 65 64 20 |able are| marked | |000009e0| 61 73 20 6e 69 6c 2e 20 | 57 65 20 63 61 6e 20 6a |as nil. |We can j| |000009f0| 75 73 74 20 6c 6f 61 64 | 20 75 70 20 74 68 65 20 |ust load| up the | |00000a00| 64 72 69 76 65 72 20 72 | 65 73 6f 75 72 63 65 20 |driver r|esource | |00000a10| 6f 75 72 73 65 6c 76 65 | 73 2c 20 74 68 65 6e 20 |ourselve|s, then | |00000a20| 6c 6f 6f 6b 20 74 68 72 | 6f 75 67 68 20 74 68 65 |look thr|ough the| |00000a30| 20 75 6e 69 74 20 74 61 | 62 6c 65 20 66 6f 72 20 | unit ta|ble for | |00000a40| 61 6e 20 65 6d 70 74 79 | 20 73 6c 6f 74 20 61 6e |an empty| slot an| |00000a50| 64 20 63 61 6c 6c 20 74 | 68 65 20 5f 44 72 76 72 |d call t|he _Drvr| |00000a60| 49 6e 73 74 61 6c 6c 20 | 74 72 61 70 20 74 6f 20 |Install |trap to | |00000a70| 63 72 65 61 74 65 20 74 | 68 65 20 64 65 76 69 63 |create t|he devic| |00000a80| 65 20 63 6f 6e 74 72 6f | 6c 20 65 6e 74 72 79 20 |e contro|l entry | |00000a90| 61 6e 64 20 69 6e 73 74 | 61 6c 6c 20 69 74 20 69 |and inst|all it i| |00000aa0| 6e 74 6f 20 74 68 65 20 | 75 6e 69 74 20 74 61 62 |nto the |unit tab| |00000ab0| 6c 65 20 73 6c 6f 74 20 | 74 68 61 74 20 77 65 20 |le slot |that we | |00000ac0| 73 70 65 63 69 66 79 2e | 20 54 68 65 6e 20 77 68 |specify.| Then wh| |00000ad0| 65 6e 20 4f 70 65 6e 44 | 72 69 76 65 72 20 69 73 |en OpenD|river is| |00000ae0| 20 63 61 6c 6c 65 64 2c | 20 69 74 20 77 69 6c 6c | called,| it will| |00000af0| 20 6a 75 73 74 20 63 61 | 6c 6c 20 74 68 65 20 64 | just ca|ll the d| |00000b00| 72 69 76 65 72 73 20 6f | 70 65 6e 20 72 6f 75 74 |rivers o|pen rout| |00000b10| 69 6e 65 20 61 6e 64 20 | 73 65 74 20 74 68 65 20 |ine and |set the | |00000b20| 66 6c 61 67 2e 20 50 72 | 6f 62 6c 65 6d 20 28 62 |flag. Pr|oblem (b| |00000b30| 29 20 69 73 20 61 20 6c | 69 74 74 6c 65 20 74 72 |) is a l|ittle tr| |00000b40| 69 63 6b 69 65 72 3a 20 | 54 68 65 72 65 20 69 73 |ickier: |There is| |00000b50| 20 61 6e 20 75 6e 72 65 | 6c 65 61 73 65 64 20 4d | an unre|leased M| |00000b60| 61 63 69 73 74 6f 73 68 | 20 54 65 63 68 6e 69 63 |acistosh| Technic| |00000b70| 61 6c 20 4e 6f 74 65 20 | 77 68 69 63 68 20 64 65 |al Note |which de| |00000b80| 73 63 72 69 62 65 73 20 | 68 6f 77 20 74 6f 20 69 |scribes |how to i| |00000b90| 6e 63 72 65 61 73 65 20 | 74 68 65 20 73 69 7a 65 |ncrease |the size| |00000ba0| 20 6f 66 20 74 68 65 20 | 75 6e 69 74 20 74 61 62 | of the |unit tab| |00000bb0| 6c 65 2c 20 61 6e 64 20 | 61 20 67 6f 6f 64 20 64 |le, and |a good d| |00000bc0| 65 61 6c 20 6f 66 20 74 | 68 65 20 63 6f 64 65 20 |eal of t|he code | |00000bd0| 69 6e 20 74 68 69 73 20 | 61 72 63 68 69 76 65 20 |in this |archive | |00000be0| 69 73 20 74 6f 20 64 6f | 20 6a 75 73 74 20 74 68 |is to do| just th| |00000bf0| 69 73 2e 0d 0d 54 68 65 | 72 65 20 69 73 20 6f 6e |is...The|re is on| |00000c00| 65 20 61 64 64 69 74 69 | 6f 6e 61 6c 20 70 72 6f |e additi|onal pro| |00000c10| 62 6c 65 6d 20 66 6f 72 | 20 54 48 49 4e 4b 20 43 |blem for| THINK C| |00000c20| 3a 20 54 48 49 4e 4b 20 | 43 20 75 73 65 73 20 72 |: THINK |C uses r| |00000c30| 65 73 6f 75 72 63 65 73 | 20 74 6f 20 68 6f 6c 64 |esources| to hold| |00000c40| 20 67 6c 6f 62 61 6c 20 | 64 61 74 61 20 61 73 20 | global |data as | |00000c50| 77 65 6c 6c 20 61 73 20 | 6d 75 6c 74 69 70 6c 65 |well as |multiple| |00000c60| 20 63 6f 64 65 20 73 65 | 67 6d 65 6e 74 73 20 66 | code se|gments f| |00000c70| 6f 72 20 69 74 73 20 64 | 65 76 69 63 65 20 64 72 |or its d|evice dr| |00000c80| 69 76 65 72 73 2e 20 4f | 66 20 63 6f 75 72 73 65 |ivers. O|f course| |00000c90| 2c 20 54 48 49 4e 4b 20 | 43 20 61 73 73 75 6d 65 |, THINK |C assume| |00000ca0| 73 20 74 68 61 74 20 69 | 74 20 63 61 6e 20 62 61 |s that i|t can ba| |00000cb0| 73 65 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |se the r|esource | |00000cc0| 49 44 27 73 20 66 6f 72 | 20 74 68 65 73 65 20 72 |ID's for| these r| |00000cd0| 65 73 6f 75 72 63 65 73 | 20 6f 6e 20 74 68 65 20 |esources| on the | |00000ce0| 73 6c 6f 74 20 6e 75 6d | 62 65 72 20 69 6e 20 74 |slot num|ber in t| |00000cf0| 68 65 20 75 6e 69 74 20 | 74 61 62 6c 65 2c 20 73 |he unit |table, s| |00000d00| 69 6e 63 65 20 74 68 65 | 20 72 65 73 6f 75 72 63 |ince the| resourc| |00000d10| 65 20 49 44 20 6f 66 20 | 74 68 65 20 64 72 69 76 |e ID of |the driv| |00000d20| 65 72 20 69 73 20 75 73 | 75 61 6c 6c 79 20 74 68 |er is us|ually th| |00000d30| 65 20 73 61 6d 65 20 61 | 73 20 74 68 65 20 73 6c |e same a|s the sl| |00000d40| 6f 74 20 6e 75 6d 62 65 | 72 2e 20 54 48 49 4e 4b |ot numbe|r. THINK| |00000d50| 20 43 20 75 73 65 73 20 | 74 68 65 20 22 6f 77 6e | C uses |the "own| |00000d60| 65 64 20 72 65 73 6f 75 | 72 63 65 22 20 73 63 68 |ed resou|rce" sch| |00000d70| 65 6d 65 20 64 6f 63 75 | 6d 65 6e 74 65 64 20 69 |eme docu|mented i| |00000d80| 6e 20 74 68 65 20 52 65 | 73 6f 75 72 63 65 20 4d |n the Re|source M| |00000d90| 61 6e 61 67 65 72 20 63 | 68 61 70 74 65 72 20 6f |anager c|hapter o| |00000da0| 66 20 49 6e 73 69 64 65 | 20 4d 61 63 69 6e 74 6f |f Inside| Macinto| |00000db0| 73 68 20 61 6e 64 20 63 | 61 6c 6c 73 20 47 65 74 |sh and c|alls Get| |00000dc0| 52 65 73 6f 75 72 63 65 | 20 66 6f 72 20 74 68 65 |Resource| for the| |00000dd0| 73 65 20 72 65 73 6f 75 | 72 63 65 73 20 65 76 65 |se resou|rces eve| |00000de0| 72 79 20 73 6f 20 6f 66 | 74 65 6e 20 77 68 65 6e |ry so of|ten when| |00000df0| 20 69 74 20 6e 65 65 64 | 73 20 74 68 69 6e 67 73 | it need|s things| |00000e00| 2e 20 42 75 74 20 73 69 | 6e 63 65 20 77 65 20 77 |. But si|nce we w| |00000e10| 69 6c 6c 20 62 65 20 70 | 75 74 74 69 6e 67 20 74 |ill be p|utting t| |00000e20| 68 65 20 64 72 69 76 65 | 72 20 69 6e 74 6f 20 61 |he drive|r into a| |00000e30| 20 72 61 6e 64 6f 6d 20 | 65 6d 70 74 79 20 73 6c | random |empty sl| |00000e40| 6f 74 2c 20 74 68 65 20 | 72 65 73 6f 75 72 63 65 |ot, the |resource| |00000e50| 73 20 77 69 6c 6c 20 70 | 72 6f 62 61 62 6c 79 20 |s will p|robably | |00000e60| 62 65 20 6e 75 6d 62 65 | 72 65 64 20 77 72 6f 6e |be numbe|red wron| |00000e70| 67 2e 20 57 65 20 63 6f | 75 6c 64 20 72 65 6e 75 |g. We co|uld renu| |00000e80| 6d 62 65 72 20 74 68 65 | 20 72 65 73 6f 75 72 63 |mber the| resourc| |00000e90| 65 73 20 69 6e 20 74 68 | 65 20 72 65 73 6f 75 72 |es in th|e resour| |00000ea0| 63 65 20 66 69 6c 65 2c | 20 62 75 74 20 74 68 61 |ce file,| but tha| |00000eb0| 74 20 61 73 73 75 6d 65 | 73 20 28 61 29 20 74 68 |t assume|s (a) th| |00000ec0| 61 74 20 69 74 20 69 73 | 20 6e 6f 74 20 6f 6e 20 |at it is| not on | |00000ed0| 61 20 72 65 61 64 2d 6f | 6e 6c 79 20 76 6f 6c 75 |a read-o|nly volu| |00000ee0| 6d 65 20 61 6e 64 20 28 | 62 29 20 74 68 61 74 20 |me and (|b) that | |00000ef0| 77 65 20 68 61 76 65 20 | 6e 6f 74 20 64 6f 6e 65 |we have |not done| |00000f00| 20 73 6f 6d 65 74 68 69 | 6e 67 20 6e 61 73 74 79 | somethi|ng nasty| |00000f10| 20 6c 69 6b 65 20 63 61 | 6c 6c 20 44 65 74 61 63 | like ca|ll Detac| |00000f20| 68 52 65 73 6f 75 72 63 | 65 20 6f 6e 20 74 68 65 |hResourc|e on the| |00000f30| 20 64 72 69 76 65 72 20 | 61 6e 64 20 63 6c 6f 73 | driver |and clos| |00000f40| 65 64 20 74 68 65 20 72 | 65 73 6f 75 72 63 65 20 |ed the r|esource | |00000f50| 66 69 6c 65 20 28 77 68 | 69 63 68 20 69 73 20 71 |file (wh|ich is q| |00000f60| 75 69 74 65 20 68 61 6e | 64 79 20 74 6f 20 64 6f |uite han|dy to do| |00000f70| 20 66 6f 72 20 64 72 69 | 76 65 72 73 20 69 6e 73 | for dri|vers ins| |00000f80| 74 61 6c 6c 65 64 20 69 | 6e 74 6f 20 74 68 65 20 |talled i|nto the | |00000f90| 73 79 73 74 65 6d 20 68 | 65 61 70 20 62 79 20 49 |system h|eap by I| |00000fa0| 4e 49 54 73 29 2e 0d 0d | 54 68 65 20 73 6f 6c 75 |NITs)...|The solu| |00000fb0| 74 69 6f 6e 73 20 74 6f | 20 61 6c 6c 20 6f 66 20 |tions to| all of | |00000fc0| 74 68 65 20 70 72 6f 62 | 6c 65 6d 73 20 70 72 65 |the prob|lems pre| |00000fd0| 73 65 6e 74 65 64 20 68 | 65 72 65 20 61 72 65 20 |sented h|ere are | |00000fe0| 69 6e 20 74 68 65 20 73 | 6f 75 72 63 65 20 63 6f |in the s|ource co| |00000ff0| 64 65 20 70 72 6f 76 69 | 64 65 64 20 69 6e 20 74 |de provi|ded in t| |00001000| 68 69 73 20 61 72 63 68 | 69 76 65 2e 0d 0d 54 68 |his arch|ive...Th| |00001010| 69 73 20 61 72 63 68 69 | 76 65 20 63 6f 6e 74 61 |is archi|ve conta| |00001020| 69 6e 73 20 34 20 73 6f | 75 72 63 65 20 66 69 6c |ins 4 so|urce fil| |00001030| 65 73 20 66 6f 72 20 75 | 73 65 20 77 69 74 68 20 |es for u|se with | |00001040| 64 65 76 69 63 65 20 64 | 72 69 76 65 72 73 2e 20 |device d|rivers. | |00001050| 54 68 6f 75 67 68 20 74 | 68 65 20 63 6f 64 65 20 |Though t|he code | |00001060| 77 61 73 20 77 72 69 74 | 74 65 6e 20 73 70 65 63 |was writ|ten spec| |00001070| 69 66 69 63 61 6c 6c 79 | 20 77 69 74 68 20 75 73 |ifically| with us| |00001080| 65 72 73 20 6f 66 20 54 | 48 49 4e 4b 20 43 27 73 |ers of T|HINK C's| |00001090| 20 64 65 76 69 63 65 20 | 64 72 69 76 65 72 20 66 | device |driver f| |000010a0| 61 63 69 6c 69 74 69 65 | 73 20 69 6e 20 6d 69 6e |acilitie|s in min| |000010b0| 64 2c 20 69 74 20 63 61 | 6e 20 62 65 20 65 61 73 |d, it ca|n be eas| |000010c0| 69 6c 79 20 75 73 65 64 | 20 69 6e 20 61 6e 79 20 |ily used| in any | |000010d0| 64 65 76 65 6c 6f 70 6d | 65 6e 74 20 65 6e 76 69 |developm|ent envi| |000010e0| 72 6f 6e 6d 65 6e 74 2e | 20 54 68 65 20 66 69 6c |ronment.| The fil| |000010f0| 65 73 20 22 64 72 69 76 | 65 72 2e 63 22 20 61 6e |es "driv|er.c" an| |00001100| 64 20 22 64 72 69 76 65 | 72 2e 68 22 20 61 72 65 |d "drive|r.h" are| |00001110| 20 74 68 65 20 72 65 61 | 6c 20 6d 65 61 74 20 6f | the rea|l meat o| |00001120| 66 20 74 68 65 20 63 6f | 64 65 3a 20 74 68 65 79 |f the co|de: they| |00001130| 20 69 6e 63 6c 75 64 65 | 20 74 68 65 20 72 6f 75 | include| the rou| |00001140| 74 69 6e 65 73 20 22 49 | 6e 73 74 61 6c 6c 52 41 |tines "I|nstallRA| |00001150| 4d 44 72 69 76 65 72 22 | 20 61 6e 64 20 22 52 65 |MDriver"| and "Re| |00001160| 6d 6f 76 65 52 41 4d 44 | 72 69 76 65 72 22 2e 20 |moveRAMD|river". | |00001170| 54 68 65 73 65 20 61 72 | 65 20 74 68 65 20 72 6f |These ar|e the ro| |00001180| 75 74 69 6e 65 73 20 79 | 6f 75 20 77 69 6c 6c 20 |utines y|ou will | |00001190| 63 61 6c 6c 20 74 6f 20 | 69 6e 73 74 61 6c 6c 20 |call to |install | |000011a0| 79 6f 75 72 20 64 65 76 | 69 63 65 20 64 72 69 76 |your dev|ice driv| |000011b0| 65 72 20 69 6e 74 6f 20 | 74 68 65 20 73 79 73 74 |er into |the syst| |000011c0| 65 6d 20 68 65 61 70 20 | 61 6e 64 20 72 65 6d 6f |em heap |and remo| |000011d0| 76 65 20 69 74 2e 20 54 | 68 65 72 65 20 69 73 20 |ve it. T|here is | |000011e0| 61 6c 73 6f 20 74 68 65 | 20 66 69 6c 65 20 22 64 |also the| file "d| |000011f0| 72 76 72 69 6e 63 6c 75 | 64 65 73 2e 68 22 2c 20 |rvrinclu|des.h", | |00001200| 77 68 69 63 68 20 69 73 | 20 69 6e 63 6c 75 64 65 |which is| include| |00001210| 64 20 62 79 20 22 64 72 | 69 76 65 72 2e 63 22 20 |d by "dr|iver.c" | |00001220| 61 6e 64 20 68 61 73 20 | 63 6f 6d 70 69 6c 61 74 |and has |compilat| |00001230| 69 6f 6e 20 6f 70 74 69 | 6f 6e 73 20 66 6f 72 20 |ion opti|ons for | |00001240| 54 48 49 4e 4b 20 43 20 | 34 2e 30 2e 78 2c 20 54 |THINK C |4.0.x, T| |00001250| 48 49 4e 4b 20 43 20 35 | 2e 30 2e 78 20 6f 72 20 |HINK C 5|.0.x or | |00001260| 4d 50 57 20 33 2e 78 20 | 61 6e 64 20 61 20 64 65 |MPW 3.x |and a de| |00001270| 66 69 6e 69 74 69 6f 6e | 20 66 6f 72 20 61 20 72 |finition| for a r| |00001280| 65 73 6f 75 72 63 65 20 | 49 44 20 79 6f 75 20 6d |esource |ID you m| |00001290| 75 73 74 20 73 65 74 2e | 20 54 68 65 20 6c 61 73 |ust set.| The las| |000012a0| 74 20 66 69 6c 65 2c 20 | 22 54 48 49 4e 4b 50 72 |t file, |"THINKPr| |000012b0| 6f 63 2e 63 22 2c 20 63 | 6f 6e 74 61 69 6e 73 20 |oc.c", c|ontains | |000012c0| 63 6f 64 65 20 66 6f 72 | 20 54 48 49 4e 4b 20 43 |code for| THINK C| |000012d0| 20 75 73 65 72 73 2e 20 | 49 74 20 73 68 6f 75 6c | users. |It shoul| |000012e0| 64 20 62 65 20 63 6f 6d | 70 69 6c 65 64 20 61 73 |d be com|piled as| |000012f0| 20 61 20 73 65 70 61 72 | 61 74 65 20 63 6f 64 65 | a separ|ate code| |00001300| 20 72 65 73 6f 75 72 63 | 65 20 77 68 69 63 68 20 | resourc|e which | |00001310| 77 69 6c 6c 20 62 65 20 | 6c 6f 61 64 65 64 20 61 |will be |loaded a| |00001320| 6e 64 20 63 61 6c 6c 65 | 64 20 66 72 6f 6d 20 77 |nd calle|d from w| |00001330| 69 74 68 69 6e 20 64 72 | 69 76 65 72 2e 63 2e 20 |ithin dr|iver.c. | |00001340| 54 68 65 20 63 61 6c 6c | 73 20 74 6f 20 47 65 74 |The call|s to Get| |00001350| 52 65 73 6f 75 72 63 65 | 20 69 6e 20 74 68 65 20 |Resource| in the | |00001360| 54 48 49 4e 4b 20 43 20 | 64 72 69 76 65 72 20 67 |THINK C |driver g| |00001370| 6c 75 65 20 61 72 65 20 | 61 63 74 75 61 6c 6c 79 |lue are |actually| |00001380| 20 72 65 70 6c 61 63 65 | 64 20 77 69 74 68 20 63 | replace|d with c| |00001390| 61 6c 6c 73 20 74 6f 20 | 74 68 69 73 20 63 6f 64 |alls to |this cod| |000013a0| 65 2e 20 49 74 20 69 73 | 20 6e 65 65 64 65 64 20 |e. It is| needed | |000013b0| 62 65 63 61 75 73 65 20 | 6f 66 20 74 68 65 20 77 |because |of the w| |000013c0| 61 79 20 54 48 49 4e 4b | 20 43 20 68 61 6e 64 6c |ay THINK| C handl| |000013d0| 65 73 20 67 6c 6f 62 61 | 6c 20 64 61 74 61 20 61 |es globa|l data a| |000013e0| 6e 64 20 6d 75 6c 74 69 | 70 6c 65 20 63 6f 64 65 |nd multi|ple code| |000013f0| 20 73 65 67 6d 65 6e 74 | 73 20 66 6f 72 20 64 65 | segment|s for de| |00001400| 76 69 63 65 20 64 72 69 | 76 65 72 73 2e 0d 0d 54 |vice dri|vers...T| |00001410| 68 65 72 65 20 61 72 65 | 20 6e 6f 20 67 6c 6f 62 |here are| no glob| |00001420| 61 6c 20 72 65 66 65 72 | 65 6e 63 65 73 20 61 6e |al refer|ences an| |00001430| 79 77 68 65 72 65 20 69 | 6e 20 74 68 65 20 63 6f |ywhere i|n the co| |00001440| 64 65 2c 20 73 6f 20 79 | 6f 75 20 6d 61 79 20 64 |de, so y|ou may d| |00001450| 65 63 69 64 65 20 74 6f | 20 63 72 65 61 74 65 20 |ecide to| create | |00001460| 61 20 6c 69 62 72 61 72 | 79 20 6f 75 74 20 6f 66 |a librar|y out of| |00001470| 20 69 74 2c 20 66 6f 72 | 20 69 6e 73 74 61 6e 63 | it, for| instanc| |00001480| 65 20 62 79 20 63 6f 6d | 70 69 6c 69 6e 67 20 69 |e by com|piling i| |00001490| 74 20 69 6e 20 61 20 70 | 72 6f 6a 65 63 74 20 69 |t in a p|roject i| |000014a0| 6e 20 54 48 49 4e 4b 20 | 43 20 61 6e 64 20 75 73 |n THINK |C and us| |000014b0| 69 6e 67 20 69 74 20 6c | 69 6b 65 20 4d 61 63 54 |ing it l|ike MacT| |000014c0| 72 61 70 73 2e 0d 0d 41 | 6c 6c 20 6f 66 20 74 68 |raps...A|ll of th| |000014d0| 65 20 63 6f 64 65 20 63 | 6f 6e 74 61 69 6e 65 64 |e code c|ontained| |000014e0| 20 69 6e 20 74 68 69 73 | 20 61 72 63 68 69 76 65 | in this| archive| |000014f0| 20 69 73 20 66 72 65 65 | 6c 79 20 64 69 73 74 72 | is free|ly distr| |00001500| 69 62 75 74 61 62 6c 65 | 2e 20 59 6f 75 20 6d 61 |ibutable|. You ma| |00001510| 79 20 75 73 65 20 69 74 | 20 69 6e 20 79 6f 75 72 |y use it| in your| |00001520| 20 6f 77 6e 20 63 6f 64 | 65 20 69 66 20 79 6f 75 | own cod|e if you| |00001530| 20 6c 69 6b 65 2e 20 41 | 6c 6c 20 74 68 61 74 20 | like. A|ll that | |00001540| 49 20 61 73 6b 20 69 73 | 20 74 68 61 74 20 79 6f |I ask is| that yo| |00001550| 75 20 67 69 76 65 20 6d | 65 20 63 72 65 64 69 74 |u give m|e credit| |00001560| 20 73 6f 6d 65 77 68 65 | 72 65 2e 0d 0d 50 65 74 | somewhe|re...Pet| |00001570| 65 20 52 65 73 6e 69 63 | 6b 00 00 00 00 00 00 00 |e Resnic|k.......| |00001580| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........| |00001590| 12 48 6e ff ec 34 01 12 | c2 68 71 50 01 09 1a 7a |.Hn..4..|.hqP...z| |000015a0| 11 ff aa 7a 01 ff ae 11 | 2d 6e 9f 01 ff b2 b7 04 |...z....|-n......| |000015b0| 1b 50 52 27 73 20 44 72 | 69 76 65 72 20 63 6f 64 |.PR's Dr|iver cod| |000015c0| 65 20 2d 20 52 45 41 44 | 20 4d 45 21 02 00 00 00 |e - READ| ME!....| |000015d0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......| |000015e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000015f0| 00 00 a9 80 18 35 00 00 | 00 00 00 00 01 1e 72 5a |.....5..|......rZ| |00001600| 2f 50 01 03 5a 5a ca 5a | 36 35 01 a8 ac 35 34 01 |/P..ZZ.Z|65...54.| |00001610| 12 d2 96 68 71 01 67 16 | 35 52 7f 7e 4d 4c 01 fc |...hq.g.|5R.~ML..| |00001620| f6 29 01 60 10 35 7f 7e | 4d 4c 01 fb fa 6d 35 34 |.).`.5.~|ML...m54| |00001630| 01 12 c2 6d 91 02 a9 77 | 4a 1f 8e 01 ff 16 34 01 |...m...w|J.....4.| |00001640| 12 ba 59 f5 01 a0 23 96 | 67 b0 02 20 4b a0 23 5a |..Y...#.|g.. K.#Z| |00001650| 5b 02 a8 73 70 02 56 34 | 01 12 aa 6d 73 c4 01 ff |[..sp.V4|...ms...| |00001660| 92 65 4e ff 00 00 02 56 | a8 9f 65 72 00 12 08 01 |.eN....V|..er....| |00001670| 00 00 03 38 2f 03 00 00 | 00 00 01 19 f8 a1 63 11 |...8/...|......c.| |00001680| 00 00 01 00 00 00 01 00 | 00 00 00 00 00 00 00 1e |........|........| |00001690| 00 00 00 00 00 00 00 00 | 00 1c 00 1e ff ff 00 00 |........|........| |000016a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000016b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000016c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000016d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000016e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| |000016f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........| +--------+-------------------------+-------------------------+--------+--------+